package qx.hyj.petrescue.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.NoArgsConstructor;
import qx.hyj.petrescue.entity.Blog;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
public class BlogVo {
    private Integer id;
    private String title;
    private String content;
    private Integer author;
    private String authorName;
    private String authorPhone;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")  //json序列化格式
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化
    @JsonSerialize(using = LocalDateTimeSerializer.class)     // 序列化
    private LocalDateTime blogtime;
    private Integer dwtype;
    private Integer blogtype;
    private Integer readed;
    private String picture;
    private Integer countOfLiked;
    private Integer countOfFavorite;
}
